//
//  MM_UploadImageModel.m
//  MallManage_IOS
//
//  Created by 张浩 on 2023/12/18.
//

#import "MM_UploadImageModel.h"

@implementation MM_UploadImageModel

- (instancetype)init {
    
    if (self = [super init]) {
        
        _canUploadImage = NO;
        _uploadStatusType = MMUploadViewTypeNone;
        
    }
    return self;
}

- (NSData *)tempFileData {
    
    NSData * data = nil;
    if (UIImagePNGRepresentation(self.tempImage)) {
        data = UIImagePNGRepresentation(self.tempImage);
    }else {
        data = UIImageJPEGRepresentation(self.tempImage,1);
    }
    
    return data;
    
}

- (void)setTempImage:(UIImage *)tempImage {
    
    tempImage = [Custom_ZHTool compressForWidthOfImage:tempImage targetWidth:640];
    _tempImage = tempImage;
    
}
@end
